package com.github.pudding.controller;

import com.github.pudding.model.Goods;
import com.github.pudding.persistence.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Stephen
 * @since 2018/9/3
 */
@Controller
public class GoodsController {

    @Autowired
    private GoodsMapper goodsMapper;

    @RequestMapping("/add")
    public void add() {
        Goods goods = new Goods();
        goods.setGoodsName("Vivo");
        goods.setOrigin("China");
        goods.setPrice(2345.00);

        goodsMapper.insert(goods);
    }
}
